﻿<cmn:UserControlBase x:Class="Hopscotch.Presentation.Controls.Core.QuantityControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:sys="clr-namespace:System;assembly=mscorlib"
             xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
             xmlns:cmn="clr-namespace:Hopscotch.Presentation.Common;assembly=Hopscotch.Presentation.Common"
             xmlns:cmnCnvrtrs="clr-namespace:Hopscotch.Presentation.Common.Converters;assembly=Hopscotch.Presentation.Common"
            
             x:Name="QuantityUserControl"
             mc:Ignorable="d" 
             d:DesignHeight="25" d:DesignWidth="300">

    <cmn:UserControlBase.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../Resources/ErrorContentControl.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </cmn:UserControlBase.Resources>


    <ContentControl Template="{StaticResource ErrorContentControl}" IsTabStop="False">
        <xctk:DoubleUpDown Name="QtyTextBox"
                               Validation.ErrorTemplate="{x:Null}"
                               Increment="{Binding Path=Increment, ElementName=QuantityUserControl}"
                               Background="{Binding Path=Background, ElementName=QuantityUserControl}"
                               TextAlignment="Left"
                               BorderThickness="0">
            <xctk:DoubleUpDown.Value>
                <Binding Path="Quantity" ElementName="QuantityUserControl" 
                            Mode="TwoWay" UpdateSourceTrigger="PropertyChanged" 
                             
                            NotifyOnValidationError="False"
                            ValidatesOnExceptions="True" 
                            ValidatesOnDataErrors="True" 
                            ValidatesOnNotifyDataErrors="True">
                </Binding>
            </xctk:DoubleUpDown.Value>
        </xctk:DoubleUpDown>
    </ContentControl>

</cmn:UserControlBase>
